package com.marui.springbootlearn.util;

import com.marui.springbootlearn.dto.po.Boss;
import com.marui.springbootlearn.dto.po.Car;
import com.marui.springbootlearn.dto.po.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;

/**
 * @author marui
 * @date 2020/1/6 19:53
 * BeanUtils.copyProperties 是深克隆
 */
@Slf4j
public class BeanUtilsDemo {


    public static void main(String[] args) {

        Car car = new Car("100*200","red");
        User user = new User("tom", "123", car);
        Boss boss = new Boss();

        BeanUtils.copyProperties(user,boss);
        System.out.println(boss.getCar());
    }


}
